Method to determine the excitation pulse positions within a speech frame

ABSTRACT

PCT No. PCT/SE96/00465 Sec. 371 Date Jan. 5, 1998 Sec. 102(e) Date Jan. 5, 1998 PCT Filed Apr. 10, 1996 PCT Pub. No. WO96/32712 PCT Pub. Date Oct. 17, 1996A determination is made of the positions within a speech frame for a given number of excitation pulses in a linear predictive speech encoder. A combination of two known methods is used. The positions of the excitation pulses are calculated in a number of calculation stages according to the first known method. The positions of the excitation pulses are then calculated in a number of calculation stages in accordance with the second method to obtain one of a number of pulse placements. Each calculation according to the second method begins at a starting point from one of a number of positions calculated in accordance with the first method. The proportion between the number of calculation stages in the first method and the second method is chosen so as to obtain the least calculation complexity for a certain given speech quality.

TECHNICAL FIELD

The present invention relates to a method of determining the positionsof excitation pulses in a speech frame in a linear predictive speechencoder which operates in accordance with the multiple pulse principle.Such a speech encoder may be used in a mobile telephone system forinstance, to compress the speech signals prior to their transmissionfrom a mobile station.

BACKGROUND

Linear predictive speech encoders which operate in accordance with theaforesaid multipulse principle are known to the art; see, for instance,U.S. Pat. No. 3,624,302 which describes linear predictive encoding ofspeech signals, and U.S. Pat. No. 3,740,476 which describes howpredictive parameters and prediction residual signals can be formed insuch a speech encoder.

When forming an artificial speech signal by means of linear predictivecoding, there are generated from the original signal a plurality ofpredictive parameters (a_(k)) which characterize the artificial speechsignal. Thus, there can be formed from these parameters a speech signalwhich does not contain the redundancy that is normally included innatural speech and which it is unnecessary to convert in speechtransmission between, e.g., a mobile and a base station in a mobileradio system. From the aspect of bandwidth, it is more suitable totransmit solely the predictive parameters instead of the original speechsignal, which requires a much higher bandwidth.

However, the speech signal thus regenerated in a receiver andconstituting a synthetic speech signal may be difficult to understand asa result of a lack of agreement between the speech pattern of theoriginal signal and the synthetic signal regenerated by means of thepredictive parameters. These deficiencies have been described in detailin U.S. Pat. No. 4,472,832 (SE-B-456618) and can be alleviated to someextent by introducing so-called excitation pulses (multipulses) whenconstructing the synthetic speech replica. This is effected bypartitioning the original speech input pattern into frame intervals.There is formed within each such interval a determined number of pulsesof varying amplitude and phase position (time position) in accordancewith the predictive parameters a_(k) and also in accordance with theprediction residual d_(k) between the speech input pattern and thespeech replica. Each of the pulses is able to influence the speechpattern replica such as to obtain the smallest possible predictionresidual. The generated excitation pulses have a relatively low bit rateand can therefore be encoded and transmitted on a narrow band, similarto the predictive parameters. This improves the quality of theregenerated speech signal.

In the aforesaid known method, the excitation pulses are generatedwithin each frame interval of the speech input pattern by weighting theresidual signal d_(k) and feeding back and weighting the generatedvalues for the excitation pulses each in a predictive filter. Acorrelation is then effected between the output signals on the twofilters and the correlation is maximized for a number of signal elementsfrom the correlated signal, such as to form the parameters (amplitudeand phase position) of the excitation pulses. The advantage afforded bythis multipulse algorithm for generating the excitation pulses is thatdifferent types of sound can be generated with a small number of pulses(for instance eight pulses/frame interval). The pulse-searchingalgorithm is general with respect to the pulse positions within theframe. It is possible to regenerate unvoiced sounds (consonants), whichgenerally require randomly placed pulses and voiced sounds (vowels)which require positioning of pulses to be more collected.

These known methods calculate the correct phase positions of theexcitation pulses within a frame and subsequent frames of the speechsignal and positioning of the pulses, so-called pulse placement, iseffected solely in dependence on complex processing of the speech signalparameters (prediction residuals, residual signal and the excitationpulse parameters in preceding frames).

One drawback with the original pulse placement methods according to theaforesaid U.S. patent is that encoding, which is effected subsequent tocalculating the pulse positions, is complex with regard to calculationsand storage. The encoding also requires a large number of bits with eachpulse position within the frame interval. Furthermore, the bits in thecode words obtained from the optimal combinatory pulse encodingalgorithms are sensitive to bit errors. A bit error in the code wordduring transmission from the transmitter to the receiver can havedisastrous consequences with regard to pulse positioning when decodingin the receiver.

This can be alleviated by restricting the number of excitation pulsesthat need be set out in each speech frame. This is made possible by thefact that the number of pulse positions for the excitation pulses withina frame interval is so large as to enable precise positioning of one ormore excitation pulses within the frame to be ignored while neverthelessobtaining a regenerated speech signal of acceptable quality afterencoding and transmission.

Accordingly, there has been proposed a method (see U.S. Pat. No.5,193,140) in which certain phase position limitations are introducedwhen setting out the pulses, by prohibiting a certain number of phasepositions that have already been determined to those pulses whichsucceed the phase position of an already calculated excitation pulse.When the position of a first pulse in the frame has been calculated andplaced in its calculated phase position, this phase position is deniedto subsequent pulses in the frame. This rule will preferably apply toall pulse positions in the frame. When commencing the localization ofpulses in a new following frame, all positions in the frame are free.

The use of so-called code books in speech encoders when generating thesynthetic speech signal has been proposed in recent times; see, forinstance, U.S. Pat. No. 4,701,954. This code book stores a number ofspeech signal code words that are used when creating the syntheticspeech replica. The code book may be fixed, i.e. contain permanent codewords, or may be adaptive, i.e. can be updated as the speech replica isformed. A combination of a fixed and an adaptive code book may also beused.

SUMMARY

The aforesaid method of prohibiting all phase positions within a speechframe where one position has already been allocated an excitation pulseresults in a more limited number of transferred excitation pulses thanwhen only one restriction is used. In addition, it is easier to encodethe phase positions of the excitation pulses on the transmitter side,while improving the separation of phase positions when decoding on thereceiver side.

One problem with the used method, however, is that the restriction canresult in poor reproduction of certain important properties, such astone pitch, transients and the like. In turn, this causes distortion ofthe received wave form. In addition, searching for all possible pulsepositions in accordance with the first-mentioned known methods resultsin excessively complex calculations, which in turn require the use ofhardware of excessively high complexity and can only be used when thenumber of available phase positions is initially low. In the case of alarge number of phase positions, it is normally necessary to adopt alower complexity when determining said positions.

According to the present invention, the first-mentioned known methodwhich lacks restrictions is combined with the last-mentioned knownmethod which requires the introduction of certain restrictions. Thesetwo known methods are combined such that a certain number of stages areeffected without restrictions and thereafter a number of sequentialsearches are made with restrictions, when in each of the phase positionsdetermined in the first search without restrictions is taken as astarting point. This allows the number of arithmetical stages withoutrestrictions to be freely selected, these stages providing exactpositions but complex calculations in relation to the number ofarithmetical stages with restrictions, which give approximativepositions but with less complex calculations, so as to enableoptimization of the total complexity when calculating the positions(phase positions) of the excitation pulses within a speech frame.

The proposed method can be applied in a speech encoder that operates inaccordance with the multipulse principle with correlation of an originalspeech signal and the impulse response of an LPC synthesized signal,with or without the use of code books in accordance with the aforegoing.However, the method can also be applied with a so-called RPE speechencoder in which several excitation pulses are set out simultaneously inthe frame interval.

BRIEF DESCRIPTION OF THE DRAWINGS

The proposed method will now be described in more detail with referenceto the accompanying drawings, in which

FIG. 1 is a simplified block schematic illustrating a known LPC speechencoder;

FIG. 2 is a time diagram showing certain signals that appear in thespeech encoder of FIG. 1;

FIG. 3 illustrates schematically a speech frame which is intended toexplain the principle of the earlier known method involving restrictionswhen determining the excitation pulses;

FIG. 4 is a block schematic illustrating part of a speech encoder thatoperates in accordance with the principle of the invention;

FIG. 5 is a block schematic illustrating part of a known speech encoderhaving an adaptive code book in which the method according to theinvention can be applied;

FIG. 6 is a flow chart for explaining the inventive method;

FIG. 7 is a diagram which illustrates the placement or setting-out ofpulses in accordance with the invention;

FIG. 8 is a diagram which illustrates the placement of pulses with theaid of phase position adjustment in accordance with the invention;

FIG. 9 is a block schematic which illustrates part of a speech encoderoperating in accordance with the inventive method; and

FIG. 10 is a block schematic which illustrates part of a speech encoderthat operates in accordance with an alternative inventive method.

DETAILED DESCRIPTION

FIG. 1 is a simplified block schematic which illustrates a known LPCspeech encoder according to the multipulse principle with correlation.Such an encoder is described in detail in U.S. Pat. No. 4,472,832(SE-B-456618). An analogue speech signal from a microphone, forinstance, appears on the input of a prediction analyzer 110. In additionto an analog-digital converter, the prediction analyzer 110 alsoincludes an LPC computor and a residual signal generator, which formpredictive parameters a_(k) and a residual signal d_(k). The predictiveparameters characterize the synthesized signal and the original speechsignal across the analyzer input.

An excitation processor 120 receives the two signals a_(k) and d_(k) andoperates during one of a number of mutually sequential frame intervalsdetermined by the frame signal FC, so as to produce a certain number ofexcitation pulses during each interval. Each pulse is therewithdetermined by its amplitude A_(mp) and its time position m_(p) withinthe frame. The excitation pulse parameters A_(mp), m_(p) are led to anencoder 131 and thereafter multiplexed with the predictive parametersa_(k) prior to transmission from a radio transmitter, for instance.

The excitation processor 120 includes two predictive filters which havethe same impulse response for weighting the signals d_(k) and (A_(i),m_(i)) in accordance with the predictive parameters a_(k) during a givencalculation or arithmetical stage p. Also included is a correlationsignal generator which effects correlation between the weighted originalsignal (y) and the weighted artificial signal (y) each time anexcitation pulse is to be generated. A number of pulse elementcandidates A_(i), m_(i) (0≦i<I) are obtained for each correlation, ofwhich candidates one (1) gives the least square error or the smallestabsolute value. The amplitude A_(mp) and the time position m_(p) for theselected candidate are calculated in the excitation signal generator.The contribution from the selected pulse A_(mp), m_(p) is thensubtracted from the desired signal in the correlation signal generator,such as to obtain a new sequence of candidates. The procedure is thenrepeated a number of times equal to the desired number of excitationpulses within a frame. This is described in detail in the aforesaid U.S.patent specification.

FIG. 2 is a time diagram of speech input signals, predictive residualsignals d_(k) and excitation pulses. In the illustrated case, theexcitation pulses are eight in number, of which the pulse A_(m1), m₁ wasfirst selected (gave the smallest error) , and thereafter A_(m2), m₂,and so on throughout the frame.

In the earlier known method for calculating amplitude A_(mp) and phaseposition m_(p) for each excitation pulse from a number of candidatesA_(i), m_(i), m_(p) =m_(i) is calculated for the candidate i which gavethe maximum value of α_(i) /.o slashed._(ij) and the associatedamplitude A_(mp) is calculated, where α_(i) is the cross-correlationvector between the signals y_(n) and the y_(n) in accordance with theaforegoing, and .o slashed._(ij) (hereinafter called C_(ij), i=j=m) isthe autocorrelation matrix for the impulse response of the predictivefilters. Any position m_(p) whatsoever is accepted when only theaforesaid conditions are to be fulfilled. Index p denotes the stageduring which an excitation pulse is calculated in accordance with theaforegoing.

According to the earlier known method in which determination of thepositions of the excitation pulses is restricted, a frame according toFIG. 2 is partitioned as illustrated in FIG. 3. It is assumed by way ofexample that the frame contains N=12 positions. The N positionstherewith form a search vector (n). The entire frame is divided intoso-called subblocks. Each subblock will then include a certain number ofphases. For instance, if the frame as a whole includes N=12 positions,as shown in FIG. 3, four subblocks are obtained with three differentphases within each subblock. The subblock has a given position withinthe frame as a whole, this position being referred to as the phaseposition. Each position n (0≦n<N) will then belong to a certain subblockn_(f) (0≦n_(f) <N_(f)) and a certain position f (0≦f≦F) in saidsubblock.

The following relationship generally applies to the positions n (0≦n≦N)positions in the total search vector containing N positions:

    n=n.sub.f F+f                                              (1);

where

f=the pulse phase within a subblock nf and F=the number of phases withinthe block nf.

n_(f) =0, . . . , (N_(f) -1), f=0, . . . (F-1) and n=0, . . . , (N-1).

The following relationship also applies:

    f.sub.p =n MOD F and n.sub.fp =n DIV F                     (1).

FIG. 3 is a schematic illustration of the distribution of the phases fpand subblock n_(fp) for a certain search vector containing N positions.In this case, N=12, F=3 and N_(F) =4.

In the known method which employs restrictions, the pulse search isrestricted to positions that do not belong to an already accommodatedphase f_(p) for those excitation pulses whose positions n have beencalculated in preceding stages.

The sequence number of a given excitation pulse calculating cycle willbe referenced p in the following, in accordance with the aforegoing. Theknown method which includes restrictions then provides the followingcalculating procedure for a frame interval:

1. Calculate the desired signal yn.

2. Calculate the cross-correlation vector α_(i).

3. Calculate the autocorrelation matrix C_(ij) (=.o slashed._(ij)i=j=m).

4. For p=1. Search for the pulse position, i.e. m_(p), that givesmaximum α₁ /C_(ij) in unoccupied phases f.

5. Calculate the amplitude A_(mp) for the discovered pulse positionm_(p).

6. Update the cross-correlation vector α_(i).

7. Calculate f_(p) and n_(fp) in accordance with the above relationship(1).

8. For p=p+1 execute the same steps 4-7.

The flow chart, which illustrates the known method more clearly, isshown in FIGS. 4a and 4b of the aforesaid U.S. Pat. No. 5,193,140.

The obtained phases f₁, . . . , f_(p) are coded together and the phasepositions (the subblocks) n_(f1), . . . , n_(fp), are each encodedindividually prior to transmission. Combinatory encoded individuallyprior to transmission. Combinatory coding can be used for encoding thephases. Each of the phase positions is encoded with code wordsindividually.

In one embodiment, the known speech process circuit that has norestrictions with regard to placement of the pulses may be modified inthe manner shown in FIG. 4, which illustrates that part of the speechprocessor which includes the excitation signal generating circuits 120.

The predictive residual signal d_(k) and the excitation generator 127are each applied to a respective filter 121 and 123 in time with a framesignal FC, through the medium of gates 122, 124. The signals y_(n) andy_(n) obtained from the respective filters 121, 123 are correlated inthe correlation generator 125. The signal y_(n) represents the truespeech signal while y_(n) represents the artificial speech signal. Thereis obtained from the correlation generator 125 a signal C_(iq) whichcontains the components α_(i) and .o slashed._(ij) in accordance withthe above. The pulse position m_(p) which provides maximum α_(i) /.oslashed._(ij) is calculated in the excitation generator 127, wherewiththe amplitude A_(mp) can also be obtained in addition to said pulseposition m_(p) in accordance with the above.

The excitation pulse parameters m_(p), A_(mp) are delivered from theexcitation generator 127 to a phase generator 129. This generatorcalculates the relevant phases f_(p) and the phase positions (subblocks)n_(fp) from the values m_(p), A_(mp) incoming from the excitationgenerator 127, in accordance with the relationship

    f=(m-1) MOD F

    n.sub.f =(m-1) DIV F

where F=the number of possible phases.

The phase generator 129 may comprise a processor which includes a readmemory that stores instructions for calculating the phases and the phasepositions in accordance with the above relationship.

The phase f_(p) and the phase position n_(fp) are then delivered to theencoder 131, FIG. 1. This encoder has the same principle construction asthe known encoder but codes phase and phase position instead of pulsepositions m_(p). The phase and phase position are decoded on thereceiver side and the decoder then calculates the pulse position m_(p)in accordance with

    m.sub.p =(n.sub.fp -1)F+f.sub.p

therewith clearly determining the excitation pulse location.

The phase f_(p) is also delivered to the correlation generator 125 andto the excitation generator 127. The correlation generator stores thisphase while observing that this phase f_(p) is occupied. No values ofthe signal C_(iq) are calculated when q is included in those positionsthat belong to all preceding f_(p) calculated for an analyzed sequence.The occupied positions are

    q=nF+f.sub.p

where n=0, . . . , (N_(f) -1) and f_(p) represent all preceding phaseswithin an occupied frame. Similarly, the excitation generator 127observes the occupied phases when comparing between signals C_(iq) andC_(iq) *.

When all pulse placements for a frame have been calculated and carriedout and the next frame is to be commenced, all phases will naturallyagain be free for the first pulse in the new frame.

FIG. 5 illustrates another type of speech encoding routine effected withthe aid of a so-called adaptive code book. The prediction analyzer 110produces the two parameters ak and dk, these parameters being used asinput magnitudes to a block referenced 111 introduced prior to theexcitation processor 120 in FIG. 4.

The block 111 contains an adaptive code book 112 which stores a numberof code words c1, . . . cn and which can be updated by a control signal.This is symbolized in FIG. 5 by means of a selector 113 which points toa given code word c_(i) in accordance with the value of the controlsignal. The code word is scaled from the code book 112 by a scale unit114 in a suitable manner, and the scaled code word is delivered to theminus input of a summator 115 whose plus input receives the predictiveresidue dk from the analyzer 110. In the illustrated case, thepredictive residue delivered to the summator 115 is referenced dk1 andthe residue obtained downstream of the summator 115 is referenced dk2.The predictive parameters ak (unchanged from the analyzer 110) and thenew prediction residue dk2 are applied to the excitation processor 120in accordance with FIG. 4.

The control signal to the selector 113 is derived from a loop whichincludes an adaptive filter 116 having the filter parameters ak, aweighting filter 117 and an extreme value former 118. The residualsignal dk2 is delivered to the filter 116 and the filtered signal isweighted in the filter 117.

A first selected code word gives a predictive residue dk2 which isfiltered and weighted in the filters 116, 117 and the least square errorE is formed in the extreme value former 118. The above procedure iscarried out for all selected code words and, after being scaled inscaler 114, that code word which gave the smallest error is subtractedfrom the residual signal d_(k1) to give a new residual signal d_(k2).This is so-called closed loop searching for the best code word whenusing an adaptive code book. The circuit shown in FIG. 5 can thus eitherbe used or not used when carrying out the inventive method. Thisimproves the value of the prediction residue d_(k) according to FIG. 1.Thus, in FIG. 4

d_(k) =d_(k1) when an adaptive code book is not used; and

d_(k) =d_(k2) when an adaptive code book is used.

As will be described below with reference to FIG. 9, the circuit shownin FIG. 5 is also used in certain blocks (132a-d) to search for theerror "closed loop", although in this case the code book is replacedwith a memory space for storing solely a pulse placement calculated withrestrictions.

The predictive parameters a_(k) and index i for the selected code wordc_(i) (smallest error) are supplied to the multiplexor 135 andtransmitted in a known manner.

The method according to the invention will now be described in moredetail with reference to FIG. 6.

At the start of a pulse placement routine, there is first determined anumber j of excitation pulses by means of the known method withoutrestrictions, block 1. These are calculated in a known manner, asdescribed above. Both the pulse positions and mp (1≦p≦j) and theamplitudes Amp within the frame are determined in this way. It is notnecessary to use the amplitude Amp of these pulses when determining withrestrictions, since each of the pulse positions calculated in accordancewith the aforegoing is used thereafter and the amplitude is therewith ofno interest. However, it is necessary to also use the amplitudes in analternative method with phase adjustment of the start pulses unless theamplitudes are recalculated.

When the number j of pulse positions mp (p=1, . . . , j) has beendetermined in this way, calculation of excitation pulses is commenced inaccordance with the known method with restrictions, block 2. Both pulseposition mp and the amplitude Amp of each excitation pulse is determinedin accordance with the known method described above. The procedure thuscommences with a starting point from the position mi (1≦i≦j) of aselected excitation pulse that has been determined in accordance withblock 1 (without restrictions) within the same frame. Calculation of thenew excitation pulses (with restrictions in accordance with the knownmethod) is effected for a given number, N1.

Subsequent to this first calculating stage with restrictions (block 2),the position mk (k=i) for a new excitation pulse is calculated inaccordance with the known method without restrictions (block 1),whereafter the same calculation routine with restrictions as thatmentioned above for the first calculation stage is also carried out forthis second calculation stage, block 3 in FIG. 6, although now with astart from another position mk (1≦k≦j; k=1). The calculation isperformed for a given number N2 of excitation pulses, where N2 may beequal to N1, however.

The calculation stages carried out by means of the known method withrestrictions are then continued for a number of times up to the laststage, block 4 in FIG. 6. The number L of such stages need not be equalto the number of positions j=P for the excitation pulses obtained inaccordance with the method without restrictions (block 1). It may besuitable to interrupt the procedure subsequent to having carried out asmall number of stages if the speech quality is found acceptable,resulting in fewer calculations. It may also be appropriate to improveaccuracy by providing more start positions than the original number ofpositions P for the excitation pulses calculated without restrictions.The resultant number of positions will then be L=P+Pextra, where Pextradenotes the extra positions. This will be described in more detail withreference to FIG. 7.

The aforementioned resultant pulse positions L=P+Pextra can be used toplace further restrictions on those pulses that shall be permitted, andtherewith reduce the complexity of the subsequent pulse searches withrestrictions. It is thus also possible to prohibit those phases fp (p=1,. . . , j) which lie furthest away from taking those pulse positionsthat have been calculated without restrictions.

According to FIG. 6, the pulse placement routine according to the methodwith restrictions is interrupted after a given number of stages (N1stages with a start from pulse p1, N2 stages with a start from pulse p2,etc.). This will result in L number of pulse placements from each of theoriginally calculated positions (without restrictions) including anyextra positions Pextra. It is then decided, block 5, which of the Lpulse placements shall be used in accordance with a given criterion. Thepulse placement that best fulfils the criterion is retained and theothers discarded. The manner in which this criterion, so-called closedloop, is formed will be explained below in more detail with reference tothe block schematic of FIG. 9, which shows the case L=4.

The thus chosen pulse placement (Amp, mp, p=1, 2, . . . , i, k, r) withrestrictions positions the final excitation pulses in the frame andcorresponds to the values of phase positions and phase positionlocations sent to the receiver. Those positions (mp, p=1, . . . , j)which have been calculated initially without restrictions are nottransmitted.

An algorithm for the calculating stages according to the aforegoing isshown in Appendix 1.

FIG. 7 is a diagrammatic illustration of excitation pulses and extrapulses calculated without restrictions and those pulse placements thatare calculated with restrictions. The pulses P1, P2, P3 and P4 are thoseexcitation pulses that have been calculated in accordance with theearlier known method (block 1, FIG. 6). These pulses have phasepositions n1, n2, n3 and n4 respectively. In addition to these pulses, afurther two pulse positions Pe1 and Pe2 with phase positions n5 and n6are calculated in accordance with the same known method in theillustrated case. Thus, the phase positions n1-n6 provide the startpositions for calculating a number of L=6 pulse placements calculated inaccordance with the known method with restrictions (blocks 2-4, FIG. 6).There are thus obtained two "extra" pulse placements which can beincluded when testing for the "best" pulse placement in accordance withthe aforesaid criterion. In FIG. 7, the start pulse in respective pulseplacements has been marked with a thick full line and a square, whilethe calculated pulses in respective pulse placements are marked withbroken lines and a ring.

The different pulse placements calculated with restrictions andbelonging to all start pulses P1-P4 and extra pulses Pe1, Pe2 are thentested in accordance with the closed loop criterion. The pulse placementthat was found to be "best"`, i.e. the placement that had the smallesterror is selected and transferred. Remaining pulse placements are notused for this particular frame.

As an alternative to the aforedescribed calculation of the positions ofthe excitation pulses, it is possible to adjust the phases of theexcitation pulses calculated without restrictions while taking therestrictions into consideration. In this case, the phases fp are chosenfor the pulse placement that was found to be the best according to saidcriterion.

For each start pulse of the total number of calculated start pulseswithout restrictions in a frame, there is defined a search area which iscomprised of a time interval of specified magnitude around the positionof the start pulse in the frame. There is then calculated on the basisof each of the start pulses a pulse placement with the restriction thatnone of the positions of the calculated pulses may lie outside thesearch area. In this way, there is obtained in addition to the positionof the start pulse concerned also a small number of positions for thosepulses that lie within the search area for the remaining start pulses.This procedure is repeated for each of the remaining start pulses andresults in a number of pulse placements where one pulse in eachplacement will always correspond to the exact position of respectivestart pulses and where the positions of remaining pulses lie withinrespective search areas for remaining start pulses.

In addition to the aforesaid pulse placement restrictions, furtherrestrictions are placed on the coding of the different pulse positionsmp obtained. This condition is applied to the different positions testedin accordance with the aforegoing prior to carrying out the closed looptest. The code restriction means that certain so-called encodablevectors are selected where each vector corresponds to a pulse placementcalculated with restrictions in accordance with the aforegoing.

The positions n (0≦n≦N) in the total search vector which contains Npositions will generally be

    n=n.sub.f F+F;

where

f=the phase within a subblock (phase position) nf and F=the number ofphases within the block nf.

There is now applied the restriction that the pulse phase for alllocations in a given pulse placement (vector) shall be different forthose vectors that have been chosen. The remainder are discarded.

All of the vectors thus obtained are considered to be encodable and arethen closed loop tested, wherein the values of the phases of the "best"pulse placement relative to each of the positions of the start pulsesare transferred to the receiver.

The complexity of the calculations and of the tests can be keptunchanged, by compiling and using a list of the various candidates indescending order with respect to the total phase adjustment, wherein thecandidate which was "next best" in a test is examined first in the nexttest, and so on throughout a complete frame.

An algorithm for the aforesaid phase position adjustment is madeapparent in the accompanying Appendix 2.

FIG. 8 is a diagram which illustrates the aforedescribed phaseadjustment of the excitation pulses that have been obtained withoutrestrictions in accordance with the aforegoing. FIG. 8a) shows thoseexcitation pulses P1, P2, P3 and P4 that have been obtained withoutrestrictions and which correspond to the pulses P1-P4 shown uppermost inFIG. 7.

There is defined for each start pulse P1-P4 of the total number ofcalculated start pulses without restrictions in a frame a search areaS1, S2, S3, S4 which is comprised of a time interval around the positionof the start pulse in the frame, FIG. 8b). Pulse positions outside eachof these search areas are non-permitted pulse positions and thusconstitute the restriction. A small number of permitted pulse positionsare found within respective search areas. For instance, respectivesearch areas will include the two pulse positions that are formed bythose positions that lie closest to the pulse position m_(i) that hasbeen calculated without restrictions. Consequently, there is calculateda number of pulse placements that can be formed from these "sidepositions" permitted around each start pulse position.

FIG. 8c) illustrates a pulse placement which is calculated with thepulse P1 as the start pulse, wherein a further three pulses have beenformed by virtue of two pulses, P2 and P4, having a phase deviationincrement calculated from the original positions of these latter startpulses, while the third start pulse P3 has been given a phase deviationfrom its associated start pulse position according to the example. Thisresults in a total phase shift=2.

With a starting point from the start pulse P2, FIG. 8d) illustrates howtwo pulses, P0 and P4, have been displaced one step to the left fromtheir associated start pulse positions, and how the fourth pulse P1 hasbeen displaced one step to the right. This results in a total phaseshift=3.

With a starting point from the start pulse P4, FIG. 8e) illustrates howtwo pulses, P2 and P3, have been displaced one step to the right fromtheir associated start pulse positions, and the first pulse P1 has beendisplaced one step to the right from its associated start pulseposition. This also results in a total phase shift=3.

The following Table can therewith be compiled:

Only two start pulse positions are taken as an example, these startpulse positions having the sequence numbers 2 and 5, wherein f_(p1),f_(p2) below have been calculated in accordance with the relationship onpage 12, line 2, with F=3.

                  TABLE                                                           ______________________________________                                        Pulse position                        Encode-                                 mp                 Shift   f.sub.p1                                                                             f.sub.p2                                                                          able                                    ______________________________________                                        Start pulse  2             5       0     2    2   No                          position                                                                      Shifted      2                 6   1     2    3   Yes                         ver-         2         4           1     2    1   Yes                         sion   1                   5       1     1    2   Yes                         of     1                       6   2     1    3   Yes                         start  1               4           2     1    1   No                          pulse              3       5       1     3    2   Yes                         posi-              3           6   2     3    3   No                          tions              3   4           2     3    1   Yes                         ______________________________________                                    

Generally, none of the phases fp may be equal for encodability, i.e.f_(p1) ≠f_(p2). The following applies when several start pulse positionsmp are used, ie p≧3

f_(p1) ≠f_(p2) ≠f_(p3) ≠f_(p4) . . . for one and the same pulseplacement.

The obtained encodable pulse placements are then mutually compared,according to "closed loop" in the aforegoing, and the phase values ofthe "best" codable placement are transferred. The amplitude Am of thepulses can be taken from the amplitude value of the start pulse used asa basis in respective pulse placements, or the amplitudes can berecalculated in order to take into account the phase change ofrespective calculated pulses.

The values of the phases fp and the phase position nfp for the "best"encodable placement are transferred.

FIG. 9 is a block schematic which illustrates part of a speech encoderthat uses the inventive method.

As in the FIG. 4 illustration, the block 125 represents a correlationgenerator which forms the magnitude Ciq=(C_(ij), α_(i)) representing thecorrelation between the signals y and y. There then follows theexcitation generator 127 which selects amplitude Amp and pulse phaseposition mp of the excitation pulse that gave the best correlation(=least square mean error) of i candidates. A total of I correlationsare carried out before determining the position and the amplitude of agiven excitation pulse. In the earlier known embodiment, the excitationgenerator 127 is followed by a phase position generator (129, FIG. 4).In the FIG. 9 embodiment, a memory unit 126 is connected instead. Thismemory unit stores the amplitudes Amp and phase positions mp (p=1, . . ., j) of the selected excitation pulses that have been obtained inaccordance with the method without restrictions (block 1, FIG. 6).

The memory unit 126 is followed by a selector unit which is symbolizedby the block 128a in FIG. 9, and a controllable switch 128b. Theselector unit 128a causes the switch 128b to seek a number of branchesfor connection of a given branch to the memory unit 126, such that agiven position mp (p=1, . . . j) stored in the memory unit 126 can forma start value in accordance with the aforegoing, block 2, FIG. 6.

The uppermost branch (a) shown in the Figure includes:

An excitation generator 127a of the same design as the excitationgenerator 127;

A phase generator 129a of the same design as the phase generator 129 inFIG. 4, and having feedback to the excitation generator 127a forupdating, c.f. FIG. 4;

A storage unit 130a; and

A calculating unit 132a for calculating the "closed loop" error E1 inaccordance with the above, and which thus has the same function as thecircuit according to FIG. 5 but without a code book. Instead of the codebook, there is provided a memory in whose storage positions the valuesof associated pulse placements a calculated with restrictions in units127a, 129a and 130a can be stored. The predictive residue d_(k2) isdelivered to the unit 132a when an adaptive code book is used, or isapplied otherwise to the predictive residue d_(k1). The predictiveparameters ak are also supplied.

Remaining branches (b), (c) and (d) include units corresponding to theunits in branch (a). Thus, each branch includes units that can determinepulse positions in accordance with the method with restrictions. Eachbranch thus provides a pulse placement calculated with restrictions,i.e. a total of four pulse placements (c.f. FIG. 7) with restrictionsare performed in accordance with FIG. 9 on the basis of four startvalues mp taken from the memory unit 126. The number of branches will,of course, be extended if more than four start values are to be used.Similarly, units 132b, 132c and 132d are provided for storing associatedpulse placements from the branches (b), (c) and (d) respectively and forcalculating the error "closed loop" E2, E3 and E4 respectively.

The selector unit 128a controls the switch contact 128b to the uppermostbranch (a) and gives to the excitation generator 127a the positions mp(p=1, . . . , j) already occupied from the pulse search withoutrestrictions (block 1, FIG. 6). The excitation generator 127a alsoreceives the updated value (Cij, α_(i)) from the correlation generatorsubsequent to said pulse search without restrictions. The excitationgenerator 127a and the phase generator 129a can now carry out a pulsesearch with restrictions starting from a given position i, since theseunits know which positions are already occupied. After a given number ofsearches, the result obtained gives a number of excitation pulses whoseamplitudes Amp and pulse positions mp are stored in the unit 130a. Inthis case, the phase f_(p) and the phase position n_(fp) are storedinstead of the pulse position mp.

The selector unit 128a then steps forward the switch 128b to theexcitation generator 127b in branch (b) and a pulse search starting froma second start value having the position m2 is commenced by the nextbranch (b). This search is carried out in the same way as the searchcarried out by branch (a) and the pulse search is thereafter extended tothe branches (c) and (d) in a similar way. The same value of Cij isapplied to all branches at the beginning of the pulse search, since thisvalue is used in testing the "candidates" when searching for the bestexcitation pulse (with restrictions).

Upon completion of a given number of parallel stages M, all branches(a)-(d) will have calculated the amplitude and phase positions/phaseposition locations of their excitation pulses and stored these values inthe storage unit 134. The calculating units 132a-132d then carry outtheir respective calculations of the error between incoming speechframes and the synthesized speech frame in accordance with the codewords used and the excitation pulses taken from respective branches. Theincoming speech signal is therefore applied to each of the units132a-132d. Each of these units calculates the closed loop error anddelivers the respective error value E1, E2, E3 and E4 as an outputsignal. It is possible to select, for instance, the square weightederror

    E=Σ/n e.sub.w (n).sup.2

where e_(w)(n) is the difference between incoming (true) speech signalsand synthesized speech signals for the values y(n) and y(n) within thespeech frame.

The function of the calculating units 132a-132d is the same as if anadaptive code book had not been used and the error E1-E4 is calculatedin the same way.

A selector unit 133a with associated switch contact 133b senses thecalculated error values E1, E2, E3 and E4 of the different pulseplacements and delivers these values to a storage unit 134 one at atime. The storage unit receives the values one after the other andselects and saves an incoming value when this value is a "better" value,i.e. is a smaller error E than the immediate preceding value. At thesame time as the unit 134 receives the values E1-E4, the unit registersthe smallest value, i.e. the "best" pulse placement. Subsequent tohaving thus identified the "best" pulse placement, the storage unit 134collects the amplitude Amp, phase fp and phase position nfp values forthis "best" pulse placement. These values are obtained via one of theconnections to respective storage units 130a-130d and are then deliveredto the encoder 131. The encoder 131 is connected to a multiplexor 135,as shown in FIG. 1.

The encoder 131 thus receives the magnitudes: amplitude Amp andphases/phase positions fp, nfp for the "best" excitation pulses compiledwith restrictions. As before mentioned, the obtained phases f₁, . . . ,f_(p) can be coded commonly and the obtained phase positions n_(f1), . .. , n_(fp) coded individually prior to transmission. The essential thingis that the phase positions and the phase position locations are codedin separate message words. This improves distinctiveness and therewithreduces the error probability.

FIG. 10 is a block schematic similar to FIG. 9 but modified for makingthe phase adjustment to starting pulses as described above (FIG. 8). Theselector 128b and subsequent blocks 127a-d, 129a-130a-d for calculatingpulse positions with restrictions have been omitted and replaced insteadwith a unit 100 which defines the aforesaid search areas for each of thestart pulses P1-P4 (FIG. 8). No excitation pulses are allowed to beplaced outside this search area and consequently the introduction of thesearch area around each start pulse and associated calculations can besaid to replace the earlier said calculation with restrictions inaccordance with FIG. 9. The unit 100 also calculates the pulse positionsfor the possible number of pulse placements in accordance with thatdescribed above (the above Table) and compiles the possible pulseplacements while taking the code restrictions into consideration. Thesecode restrictions are thus obtained over the outputs a, b, c and d andthe obtained pulse placements are then delivered to the units 132a-132dwhich calculate respective closed loop errors E1, E2, E3 and E4 in themanner earlier described.

Since no value of the amplitudes of the pulse placement selected forcoding in the encoder 131 was delivered to the unit 100, the amplitudevalues Amp of each of the pulse placements are delivered from the memoryunit 126 to the calculating units 132a-132d and to the storage units134.

When coding the phase positions and the phase position locationsrespectively, these positions and position locations can be combinedseparately, in twos or in greater multiples in a message block includingassociated parity words in a known manner. Coding of a single word forphase position and phase position location respectively with anassociated parity word can also be carried out. The advantage of havingseveral values in a message word is that a saving is made in bandwidth,although it is then necessary to use "harsher" coding in order to obtainbetter protection. Although simpler coding with less protection can beapplied in the latter case with only one phase value or phase positionvalue, it will result nevertheless in a loss in bandwidth. Coding of thephases can be effected with combinatory coding.

It will be understood that FIGS. 9 and 10 merely illustrate theprinciple of how associated circuits of a speech encoder can beconstructed. In reality, all units may be integrated in a microprocessorwhich is programmed to carry out the functions in accordance with theflow chart of FIG. 6 and the accompanying Appendix 1 and Appendix 2.

Speech quality can be improved by the proposed method in comparison withthe known method with restrictions and lower complexity. Since bothknown methods with and without restrictions are used, it is possible toselect the proportion between the number of calculated excitation pulsesaccording to the methods with and without restrictions respectively andin this way obtain optimal distribution which provides the lowestcalculation complexity for a given desired speech quality. Thecalculation complexity is greatly reduced in comparison when an extremevalue calculation is made for all possible positions within a speechframe.

The inventive method has been described above in conjunction with aspeech encoder in which the excitation pulses are placed in position onepulse at a time until a frame interval has been filled. EP-A 195,487describes another type of speech encoder which operates with a pulsepattern placement procedure in which the time distance t_(a) between thepulses is constant, instead of a single pulse. The inventive method canalso be applied with such a speech encoder. In this case, the forbiddenpositions in a frame (c.f. FIGS. 4a, 4b above, for instance) coincidewith the positions of the pulses in a pulse pattern.

Appendix 1

Algorithm for the calculating stages according to the flow chart of FIG.6.

Modified calculation stages 1-8 are disclosed in U.S. Pat. No.5,193,140.

U.S. Pat No. 5,193,140 is designated [2] below.

The autocorrelation matrix .o slashed.ij in [2] is below designated C(i,j)=Cij in the descriptive part of the Application.

The pulse positions mp and mq in [2] are designated ms_(p) and ms_(q)respectively in the present case.

The magnitude α_(i) in [2] and in the descriptive part of thespecification are here designated a(i).

Analogous for α_(m) in [2] in relation to a(m) below.

1. Calculate the desired signal y(n).

2. Calculate the cross-correlation vector a(i) and copy to asave(i).

3. Calculate the covariance (or autocorrelation) matrix C(ij).

4. For p=1 to P+extra.

4.1 Search for ms_(p), i.e. the pulse position which gives the maximuma(i)*a(i)/C(ij)=a(ms)*a(ms)/C(ms,ms) in the unoccupied positions.

4.2 Calculate the amplitude A(ms_(p)) for the discovered pulse positionms_(p).

4.3 Update the cross-correlation vector a(i).

4.4 Discard the found position ms_(p) from the possible positions.

5. For q=1 to P+extra.

5.1 Copy asave(i) to a(i).

5.2 Assign m₁ the value of ms_(q).

5.3 Calculate the amplitude A(m₁) for the starting pulse position m₁.

5.4 Update the cross-correlation vector a(i).

5.5 For p=2 to P.

5.5.1 Search for m_(p), i.e. the pulse position which gives maximuma(i)*a(i)/C(ij)=a(m)*a(m)/C(m,m) in the unoccupied phases.

5.5.2 Calculate the amplitude A(m_(p)) for the discovered pulse positionm_(p).

5.5.3 Update the cross-correlation vector a(i).

5.5.4 Exclude the positions with the same phase as m_(p).

5.6 Calculate closed-loop error E.

5.7 If the error E is lower than the error for the previously saved setof positions and amplitudes, save the positions m_(p) as mw_(p) and theamplitudes A(m_(p)) as A(mw_(p)).

6. Calculate f_(p) and n_(fp) in accordance with the relationship (1) in[2] for the saved (winning) set of positions mw_(p).

Appendix 2

Algorithm for phase position adjustment.

Designations according to Appendix 1.

1. Calculate the optimal positions ms_(p) and amplitudes A(ms_(p)) as instep 1 through 4 in the previous section. (Appendix 1).

2. Construct the n=((P+extra) over P) combinations of P positions out ofthe ms_(p) optimal positions.

3.0 For combination_(i) =combination₁ to combination_(n).

3.1 Shake all positions in combination₁ around by shifting each positionone step in each direction. If the resulting set of positions areencodable using the restricted positioning code, save them in a listmin₋₋ shift₋₋ list with an ordering in respect to the total phase shiftfrom the unshifted combination_(i).

4.0 For j=1 to nb₋₋ to₋₋ test.

4.1 Copy the positions at the top of the min₋₋ shift₋₋ list to mv_(p).

4.2 Remove the top positions in the list min₋₋ shift₋₋ list.

4.3 Copy the amplitudes from A(ms_(p)) of the corresponding unshiftedcombination_(i) to A(mv_(p)).

4.4 Calculate closed-loop error Ej, using mv_(p) and A(mv_(p)).

4.5 If the error Ej is lower than the error for the previously saved setof positions and amplitudes, save the positions mv_(p) as mw_(p) and theamplitudes A(mv_(p)) as A(mw_(p)).

5. Calculate f_(p) and n_(fp) in accordance with the relationship (1) in[2] for the saved (winning) set of positions mw_(p).

What is claimed:
 1. A method of determining the positions within aspeech frame of a given number of excitation pulses in a linearpredictive speech encoder in which a speech signal divided in speechframes is analyzed and the analyzed speech signal is synthesized to forma prediction residue and a number of predictive parameters, which,according to a first method, are applied to an excitation processorwhich filters the prediction residue and the parameters obtained fromthe excitation processor for each of the desired excitation pulses inaccordance with said predictive parameters, wherein according to asecond method a speech frame is also divided into a number of phasepositions and each phase position is divided into a number of phases andrestrictions are inserted to the effect that the phase that is occupiedwhen placing an excitation pulse is prohibited to each subsequentexcitation pulse and to each phase position within the speech frame, themethod comprising the steps ofa) calculating the positions of theexcitation pulses in a number of calculation stages in accordance withthe first method; b) calculating the positions of the excitation pulsesin a number of calculation stages in accordance with the second method,each stage with a starting point from one of a number of positionscalculated in accordance with the first method, therewith to obtain oneof a number of pulse placements; and c) choosing the proportion betweenthe number of calculation stages according to the first and the secondmethod, respectively, so as to obtain the least calculation complexityfor a certain given speech quality.
 2. A method according to claim 1,wherein the number of pulse positions calculated in accordance with saidfirst method is smaller than the least number of pulse positionscalculated in accordance with said second method.